<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{$person}</title>
    {include file="inset/head/head_css.tpl"}
    {include file="inset/head/head_js.tpl"}
</head>
<body>
    	
   
    <div class="wrapper">
        {include file="inset/header.tpl"}
        
        {include file="inset/menu/vermenu.tpl"}
	
        <div class="content">
	    <div class="toolbar">
		<div title="Обновить" id="toolbar_refresh" class="toolbar_button refresh"></div>
		<div title="Сохранить" id="toolbar_save" class="toolbar_button save"></div>
		<div title="Печать"  id="toolbar_print" class="toolbar_button print"></div>
		<div title="Сформировать отчёт" id="toolbar_report_cl" class="toolbar_button report"></div>
	    </div><!--toolbar-->
	    
            <div class="detailed">
		<form>
		    <div class="cl_data">
			<div><label>Код клиента:</label></div>
			<div><input id="id" type="text" readonly style="background:#e1e1e1;width:130px;" value="{$client_data.0.id}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>Фамилия:</label></div>
			<div><input id="name"  class="validate[required,custom[onlyLetterSp],minSize[3],maxSize[100]]" type="text" value="{$client_data.0.name}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>Имя:</label></div>
			<div><input id="first_name" class="validate[required,custom[onlyLetterSp],minSize[3],maxSize[100]]" type="text" value="{$client_data.0.first_name}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>Отчество:</label></div>
			<div><input id="second_name"  class="validate[custom[onlyLetterSp],minSize[3],maxSize[100]]" type="text" value="{$client_data.0.second_name}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>Телефон:</label></div>
			<div><input id="phone" class="validate[required,custom[phone]]" type="text" value="{$client_data.0.phone}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>e-mail:</label></div>
			<div><input id="email" type="text"  class="validate[custom[email]]"  value="{$client_data.0.email}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>Область:</label></div>
			<div>
			    <select class="validate[required]" id="region">
				{for  $i=0 to $region|@count-1}
				    {if $client_data.0.region ==$region.$i.region}
				    <option class="sel" value="{$region.$i.region_id}" selected>{$region.$i.region}</option>
				    {else}
				    <option value="{$region.$i.region_id}">{$region.$i.region}</option>
				    {/if}
				{/for}
			    </select>
			</div>
		    </div>
		    <div class="cl_data">
			<div><label>Город:</label></div>
			<div>
			    <select class="validate[required]" id="city">
			    {for  $i=0 to $city|@count-1}
				{if $client_data.0.city == $city.$i.city}
				<option value="{$city.$i.city}" selected>{$city.$i.city}</option>
				{else}
				<option value="{$city.$i.city}">{$city.$i.city}</option>
				{/if}
			    {/for}
			    </select>
			</div>
		    </div>
		    <div class="cl_data">
			<div><label>Улица:</label></div>
			<div><input type="text" id="street" class="validate[required]" value="{$client_data.0.street}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>Дом:</label></div>
			<div><input type="text"  id="house"   class="validate[required]" value="{$client_data.0.house}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>Подъезд:</label></div>
			<div><input id="porch" type="text" value="{$client_data.0.porch}"/></div>
		    </div>
		    <div class="cl_data">
			<div><label>Квартира:</label></div>
			<div><input type="text"  id="houseroom" class="validate[required]" value="{$client_data.0.houseroom}"/></div>
		    </div>  
		</form>
            </div><!--detailed-->
            
	    <div class="cl_orders">
		<h4>Количество заказов: {$report_data.count_order}</h4>
		<h4>Общая сумма заказа: {$report_data.total_cost} грн</h4>
		
		<div class="order_detailed">
		    <div title="Скрыть/показать" class="toolbar_button toggle"></div>
		    <table id="order_detailed" class="none">
			<tr>
			   <th width="10%">Код</th>
			   <th width="27%">Менеджер</th>
			   <th width="27%">Название продукта</th>
			   <th width="12%">Дата заказа</th>
			   <th  width="10%">Количество</th>
			   <th  width="14%">Стоимость, грн</th>
			</tr>
			  {for $i=0 to $order_data|@count-1}
			<tr>
			   <td>{$order_data.$i.id}</td>
			   <td>{$order_data.$i.person}</td>
			   <td valign="top">
                               {for $j=0 to $order_data.$i.product|@count-1}
                                    {$order_data.$i.product.$j}<br/>
                               {/for}
                           </td>
			   <td>{$order_data.$i.date_create}</td>
			   <td valign="top">
                               {for $k=0 to $order_data.$i.count|@count-1}
                                {$order_data.$i.count.$k}<br/>
                               {/for}
                           </td>
			   <td valign="top">
                               
                               {for $l=0 to $order_data.$i.price|@count-1}
								{if ($order_data.$i.price|@count >1)}
							   
									{$order_data.$i.price.$l}<br/>
								{/if}
                               {/for}
							   <span style="color:red;">{$order_data.$i.priceall}</span>
                           </td>
			</tr>
			{/for}
		    </table>
		</div>
		
	    </div> <!--/orders-->
	</div>
    </div>
    {include file="inset/footer.tpl"}
</body>
</html>
